function [A,B,ys] = find_dynare_transition_eq_matrices(oo_, M_)

% Computes the linear approximation and the matrices A and B of the
% transition equation
%
% INPUTS
%    results of Dynare estimation or simulation
%
% OUTPUTS
%    A:              matrix of predetermined variables effects in linear solution (ghx)
%    B:              matrix of shocks effects in linear solution (ghu)
%    ys:             steady state of original endogenous variables
%


A = [];
B = [];
ys = [];



endo_nbr = M_.endo_nbr;
nstatic = oo_.dr.nstatic;
npred = oo_.dr.npred;
iv = (1:endo_nbr)';
ic = [ nstatic+(1:npred) endo_nbr+(1:size(oo_.dr.ghx,2)-npred) ]';


if nargout==1
    A = kalman_transition_matrix(oo_.dr,iv,ic,M_.exo_nbr);
    return
end

[A,B] = kalman_transition_matrix(oo_.dr,iv,ic,M_.exo_nbr);
ys = oo_.dr.ys;